package com.sqx.modules.errand.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.entity.UserEntity;
import com.sqx.modules.errand.entity.ErrandAddress;
import com.sqx.modules.errand.entity.ErrandEvaluate;
import com.sqx.modules.errand.entity.ErrandRedPacket;
import com.sqx.modules.errand.entity.TbIndent;
import com.sqx.modules.order.entity.TbOrder;

import java.util.List;

public interface TbIndentService extends IService<TbIndent> {

    Result insertIndent(TbOrder order);

    Result findNewIndent(Long userId, String receivingPettern, Integer page, Integer limit, double riderLng, double riderLat, String indentType, String buyType);

    Result indentReceiving(Long userId, String indentNumber);

    Result riderBuyGoods(TbIndent tbIndent);

    Result findRiderIndent(Long userId, Integer page, Integer limit, String indentState);

    TbIndent indentMessage(String indentNumber, double ol, double od);

    Result riderCancleIndent(String indentNumber,Integer type);

    Result riderDelivery(Long userId, String indentNumber, String itemCode);

    Result userDelivery(Long userId, String indentNumber);

    Result userEvaluate(ErrandEvaluate errandEvaluate);

    Result findallIndent(Integer page, Integer limit, Long userId, Long riderUserId, Long shopId,Integer indentType,Integer ordersNo,Integer status,String riderPhone);

    void finshIndent(Long userId, String indentNumber);

    Result distance(double ol, double od, double dl, double dd);

    Result addUserAddress(Long userId, ErrandAddress errandAddress);

    Result updateAddress(Long userId, ErrandAddress errandAddress);

    Result findUserAddress(Long userId);

    Result findAddressById(Long userId, Integer addressId);

    Result addDefaultAddress(Long userId, Integer addressId);

    Result delUserAddress(Long userId, Integer addressId);

    TbIndent basicsMoney(TbIndent tbIndent);

    Result addIndentBuy(TbIndent tbIndent);

    TbIndent findIndentByIndentNumber(String orderId);

    Result findAllIndent(String indentType, String phone, String indentState, Integer page, Integer limit, String date, String dateType,String riderPhone);

    Result findAllIndents(String indentType, String phone, String indentState, Integer page, Integer limit, String date, String dateType,String riderPhone);

    Result IndentCenter(Integer page, Integer limit, String indentType, String indentNumber, String indentState, String phone, String date, String dateType);

    Result updateIndentState(String indentNumber, String indentState);

    Result adminSoldOutIndent(String indentNumber);

    Result findDataCenter();

    Result taskAnalysis(String dateType, String date, Integer page, Integer limit, String indentState);

    Result selectOrderByStatus(String date, String dateType);

    Result findIncome(Long userId, String date, String dateType, Integer page, Integer limit);

    Result findUserIndent(Long userId, Integer page, Integer limit, String indentState);

    TbIndent userIndentMessage(String indentNumber);

    Result find5KmRider(double lng, double lat);

    Result updateCoordinate(Long userId, double lng, double lat);

    UserEntity findUserInfoById(Long userId);

    Result getNewUserRedPacket(Long userId);

    List<ErrandRedPacket> findAllRedPacket(Long userId);

    List<ErrandRedPacket> findRedPacket(Long userId, TbIndent indent);

    Result userCancleIndent(Long userId, String indentNumber);

    TbIndent indentMessageByOrderId(Long orderId, double ol, double od);

}
